import requests

class lianjie:
    def __init__(self,base_url,timeout=10):
        # 可添加公共请求头、基础URL等配置
        self.base_url = base_url
        # 初始化会话（可维护Cookie、会话保持等）
        self.session = requests.session()
        self.timeout = timeout

    def post(self, path, **k):
        url = f'{self.base_url}{path}'
        return self.session.post(url, **k)

    def put(self, path, **k):
        url = f'{self.base_url}{path}'
        return self.session.put(url, **k)

    def get(self, path, **k):
        url = f'{self.base_url}{path}'
        return self.session.get(url, **k)

    def delete(self, path, **k):
        url = f'{self.base_url}{path}'
        return self.session.delete(url, **k)